/**
 * Copyright 2010 Balaji Thennarangam.
 */
package com.kathez.logging;

import java.util.logging.Logger;

/**
 * Default implementation of the IKathezLogger.
 * This object may be returned from the KathezLoggerFactory
 * 
 * @author Balaji T
 *
 */
public class KathezLogger {

	private static Logger logger = null;
	
	/* (non-Javadoc)
	 * @see com.kathez.logging.IKathezLogger#getLogger()
	 */
	public static Logger getLogger() {
		if(logger == null)
			return Logger.getAnonymousLogger();
		else
			return logger;
	}

	/* (non-Javadoc)
	 * @see com.kathez.logging.IKathezLogger#getLogger(java.lang.String)
	 */
	public static Logger getLogger(String loggerName) {
		if(logger == null)
			return Logger.getLogger(loggerName);
		else
			return logger;
	}

	/* (non-Javadoc)
	 * @see com.kathez.logging.IKathezLogger#getLogger(java.lang.Class)
	 */
	public static Logger getLogger(Class<?> clazz) {
		if(logger == null)
			return Logger.getLogger(clazz.getCanonicalName());
		else
			return logger;
	}
}
